# import flask
#
# from flask_cors import CORS
#
# app = flask.Flask(__name__)
#
#
# @app.route('/')
# def hello():
#     return "你好"
#
#
# if __name__ == "__main__":
#     CORS(app, supports_credentials=True)
#
#     app.run(host="0.0.0.0",port="5000")

import flasks
import pymysql
from flask_cors import CORS

app = flask.Flask(__name__)
CORS(app, supports_credentials=True) #解决跨域问题
@app.route('/')

def hello():
    return "你zhen好"

@app.route('/select')

def select():
    db = pymysql.Connect("127.0.0.1","root","123456","test")
    cursor = db.cursor()
    sql = "select * from user"
    cursor.execute(sql)
    rows=cursor.fetchall()
    db.close()
    return rows



if __name__ == "__main__":
    app.run(debug=True, host='0.0.0.0', port=5000)